package samples.chapter04;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/chapter04/user")
@RestController
public class Chapter04UserController {
    @Autowired
    Chapter04UserService userService;

    @GetMapping("/getUserByid")
    public String getUserById(Integer id) {
        return userService.getUser(id);
    }

    @GetMapping("deleteUserByid")
    public void deleteUserById(Integer id) {
        userService.deleteUserById(id);
    }
}
